<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="待审核变更样品" name="1">
        <ApproveChangeList ref="ApproveChangeList" :samp-task-id="sampTaskId" />
      </el-tab-pane>
      <el-tab-pane label="已审核变更样品" name="2">
        <ApproveChangeHisList ref="ApproveChangeHisList" :samp-task-id="sampTaskId" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import ApproveChangeList from './approve/approveChangeList.vue'
import ApproveChangeHisList from './approve/approveChangeHisList.vue'
export default {
  components: { ApproveChangeList, ApproveChangeHisList },
  data() {
    return {
      activeName: '1',
      sampTaskId: ''
    }
  },
  created() {
    if (this.$route.params.sampTaskId) {
      this.sampTaskId = this.$route.params.sampTaskId
    }
  },
  methods: {
    handleClick() {
      if (this.activeName == 1) {
        this.$refs.ApproveChangeList.handleSearch()
      } else {
        this.$refs.ApproveChangeHisList.handleSearch()
      }
    }
  }
}
</script>
